<!-- welcome/index -->

<h1>Spends</h1>

<%= flash_alerts %>

<div class="row-fluid">
	<div class="span6 full-border spacer">
		<% if @contas.any? %>
			<h2 class="text-center">Contas</h2>
		
			<table class="table table-striped">
				<thead>
					<tr>
						<th class="table-header">Conta</th>
						<th class="table-header">Saldo</th>
					</tr>
				</thead>
			
				<tbody>
					<% @contas.each do |c| %>
						<tr>
							<td class="table-cell text-center">
								<%= link_to c.nome, conta_path(c) %>
							</td>
							<td class="table-cell text-center">
								<span class="<%= (c.saldo > 0) ? 'credito' : 'debito' %>">
									<%= number_to_currency c.saldo %>
								</span>
							</td>
						</tr>
					<% end %>
				</tbody>
			
			</table>
		<% end %>
	</div>
</div>
